package com.hospital.controller;

import com.hospital.dto.EquPayDto;
import com.hospital.entity.Equipment;
import com.hospital.entity.Equpay;
import com.hospital.service.intf.EqupayService;
import com.hospital.vo.PageBean;
import com.hospital.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/equpay/")
public class EqupayController {
    @Autowired
    private EqupayService service;


        @RequestMapping("add.do")
    public R add(Equpay equpay) {
        System.out.println(equpay);
        return service.add(equpay);
    }

    @GetMapping("dele.do")
    public R delectById(int id){
        return service.deleById(id);
    }

    @GetMapping("page.do")
    public PageBean selectPage(int page, int limit){
        return service.selePage(page,limit);
    }

    @PostMapping("deleids.do")
    public R deleids(int[] ids){
        return service.deleids(ids);
    }

    @GetMapping("querylog.do")
    public PageBean querylog(int page, int limit){
        return service.querylog(page,limit);
    }

    @RequestMapping("save.do")
    public R save(EquPayDto equPayDto) {
        return service.save(equPayDto);
    }
}


